<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/10
 * Time: 0:07
 */

$image = dirname(__FILE__).'/../public/image/verify_1.gif';
//$img = getimagesize($image);	//获取图片属性	print_r($img);
$im = imagecreatefromgif($image);	//定义图片编码格式
$in = imagecreatefromgif($image);	//备份

$te = imagecolorallocate($im,67,83,109);	//颜色变量

$_SESSION['verific'] = rand(0,9).rand(0,9).rand(0,9).rand(0,9);	//验证码


$str = iconv('gbk','UTF-8',$_SESSION['verific']);	//定义绘制的文字
imagettftext($im,18,0,4,26,$te,dirname(__FILE__).'/../public/image/ARCADE_I.TTF',$str);	//定义混合图片

header('Content-type: image/gif'); 	//发送标头信息
imagegif($im);
imagedestroy($im);
